package com.idbk.chargestation.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * 网络相关的工具类
 * @author lupc
 *
 */
public class NetUtil {

	/**
	 * 检查当前是否是wifi环境
	 * @param mContext context
	 * @return 是否是wifi环境
	 */
	public static boolean isWifi(Context mContext) {    
	    ConnectivityManager connectivityManager = (ConnectivityManager) mContext    
	            .getSystemService(Context.CONNECTIVITY_SERVICE);    
	    NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo(); 
	    if (activeNetInfo != null    
	            && activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI) {    
	        return true;    
	    }    
	    return false;    
	}  
	
	
}
